package com.training.java.core.collections.Set.Car;

import java.util.HashSet;
import java.util.Set;

public class SchoolSetDemo {

	public static void main(String[] args) {

		School school1 = new School("Legacy", "Ashburn", 7);
		School school2 = new School("Riverdale", "Herndon", 5);
		School school3 = new School("Hillside", "Farmington", 3);
		School school = new School("Hillside", "Farmington", 3);
		School school22 = new School("Riverdale", "Herndon", 5);

		Set<School> schools = new HashSet<School>();

		schools.add(school1);
		schools.add(school2);
		schools.add(school3);
		schools.add(school);
		schools.add(school22);

		for (School aSchool : schools) {
			System.out.println("Name of School = " + aSchool.getName());
			System.out.println("City = " + aSchool.getCity());
			System.out.println("Great School Ranking = "
					+ aSchool.getGreatSchoolRanking());

		}

	}

}
